package Day08_19;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.util.ArrayList;

public class Test_Serialize02 {
    public static void main(String[] args) {
        try {
            ObjectInputStream ois = new ObjectInputStream(new FileInputStream("myFile"));
           //ArrayList<Student> list = (ArrayList<Student>)  ois.readObject();
             ArrayList<Student> arrayList = (ArrayList<Student>) ois.readObject();
           // System.out.println(obj instanceof ArrayList );
            for (Object i : arrayList){
                System.out.println(i);
            }
           ois.close();

        } catch (IOException e) {
            throw new RuntimeException(e);
        } catch (ClassNotFoundException e) {
            throw new RuntimeException(e);
        }

    }
}
